package com.example.textgame;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import org.w3c.dom.Text;

public class MainActivity extends AppCompatActivity {
private Button btn1;
private Button btn2;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        btn1 = (Button) findViewById(R.id.button1);
        btn2 = (Button) findViewById(R.id.button2);
        btn1.setOnClickListener(new View.OnClickListener(){
            @Override
            public void onClick(View view){
                btn1.setText("abc");
//                Intent intent = new Intent(MainActivity.this, Text2.class);
//                intent.putExtra("key","1");
//                startActivityForResult(intent,requestCode:1);
               // Intent intent = new Intent();
                Intent intent = new Intent(MainActivity.this, Text2.class);
//                intent.putExtra("key","1");
                intent.setAction(Intent.ACTION_VIEW);
//                intent.putExtra("key","1");
//                intent.setData(Uri.parse("Text2.class"));
                startActivity(intent);
            }
        });
        btn2.setOnClickListener(new View.OnClickListener(){
            @Override
            public void onClick(View view){
                btn2.setText("abcff");
            }
        });

    }



    @Override
    protected void onStart() {
        super.onStart();
    }

    @Override
    protected void onResume() {
        super.onResume();
    }

    @Override
    protected void onPause() {
        super.onPause();
    }

    @Override
    protected void onStop() {
        super.onStop();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
    }
}
